-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first step to integrate grobner to coqeal #70
base: master
Are you sure you want to change the base?
Conversation
This is great! But I think we need some documentation as well in the README.md to advertise the fact that we have a Gröbner basis and Buchberger algorithm formalization. It may be easiest to do this in a followup PR once this one is merged - I can do that documentation PR if @proux01 is OK with it. |
@palmskog sure, feel free to open a separate documentation PR based on the current one, I'll rebase/merge it after the current one. |
@thery thanks for the submission. I'd like to take some time to review it reasonably carefully, so please don't expect anything before next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thery I had only a rather quick look, but here are already a few comments.
theory/grobner.v
Outdated
Definition plt p q : bool := | ||
has (fun m2 => | ||
[&& m2 \notin msupp p, | ||
all (fun m1 => ((m1 < m2)%O || (m1 \in msupp q))) (msupp p) & | ||
all (fun m1 => ((m1 <= m2)%O || (m1 \in msupp p))) (msupp q)]) | ||
(msupp q). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a lexicographic order, why not defining it as
Import Order.DefaultSeqLexiOrder.
Definition ple p q : bool := (sort >=%O (msupp p) <= sort >=%O (msupp q))%O.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used it but I am not sure it makes my life easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not expecting it to make life easier by itself, but it seems to me that some lemmas in grobner.v are just generic properties on lexicographic orders. If they are not in order.v they could be added first in ssrcomplents (and later backported). I would expect this to simplify proofs in grobner.v while providing more reusable material.
Qed. | ||
|
||
Lemma plt_msuppl (p q r : {mpoly R[n]}) : | ||
perm_eq (msupp p) (msupp q) -> (p < r) = (q < r). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's rather a question related to multinomials, but those perm_eq
make me wonder whether msupp
should not be defined as sort >=%O (dom p)
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that there is many notion of orders in polynomial. There is no reason to fix one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure but not fixing any order means msupp
currently has no canonical form, hence this kind of lemmas with perm_eq
. Multinomials chose an order on monomials, I think it makes some sense to use it to make msupp
canonical (as offered in math-comp/multinomials#66 ). Even if this order is somewhat arbitrary, it seems better than no order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe msupp should take an order as parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe. Can I let you try that in multinomials? ( math-comp/multinomials#66 should be a good starting point)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not very successful. It starts going wrong here.
Now that mlead is parametrized most theorems need extra properties on the order that I don't know
how to package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any good solution right now.
Best short term solution is probably to use a functor to put generic lemmas taking a module with the order properties as argument. This functor could then be instantiated to get the lemmas for any specific order.
A better solution would probably be to have order structures on relations (o : rel T
) instead of just types (T
), like Monoid
in bigop
, maybe something to discuss in a forthcoming MathComp meeting (maybe @pi8027 would have a better idea).
Adding the file grobner.v